<?php
/**
 * Created by PhpStorm.
 * User: zhao shou qiang
 * Date: 2018/1/8 0008
 * Time: 15:07
 */

use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use backend\assets\AppAsset;
use backend\controllers\DtActionFilter;

/* @var $this yii\web\View */
AppAsset::register($this);

$this->title = '立项评估';
?>

<!-- 删除模态框开始（Modal）  开始!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<input type="hidden" id="rouse_modal" data-toggle="modal" data-target="#deleModal"/>
<div class="modal fade package_investigation" id="deleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog2" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true"><img src="/image/assetPackage/close.png" class="modal_close"></span>
                </button>

                <div class="pull-left modal-nav">
                    <img src="/image/assetPackage/white.png" class="pull-left">
                    <span class="pull-left">删除选项</span>
                </div>
            </div>
            <div class="modal-body modal-body-delete">
                <p>您确定删除选中内容吗？</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btns-primary " data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary btns-primary investigation_modal_delete">确定</button>
                <input type="hidden" class="model_url" value="">
                <input type="hidden" class="model_id" value="">
                <input type="hidden" class="model_order" value="">
            </div>
        </div>
    </div>
</div>
<!-- 删除模态框开始（Modal）  结束!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

<div class="container content content2">
    <div class="row">
        <!-- 右侧边栏 -->
        <div class="content-right pull-right  col-md-12">
            <!-- 1. 立项信息一栏-->
            <div class="perfect-information row container-fluid mb10 clearfix" id="jdpg1">
                <?php
                if (DtActionFilter::checkPackage('package_edit', $data['id']))
                    echo '<img src="/image/assetPackage/edit.png" class="edit-img base_info" >';
                ?>
                <div class="perfect-logo mb23 clearfix">
                    <img src="/image/officeHall/uploadAssetPackage/wsxx.png" class="pull-left">
                    <span class="pull-left">立项信息</span>
                </div>


                <!-- 资产包基本情况 -->
                <div class="perfect-logo  perfect-logo2 perfect-information-logo mb23 clearfix">
                    <span class="pull-left">1.资产包基本情况</span>
                </div>
                <div class="base_info_toggle">
                    <?php echo \Yii::$app->view->renderFile('@app/views/package/investigation/base-info.php',
                        ['data' => $data, 'editFlag' => $editFlag]); ?>
                </div>


                <!-- 流转、前期处置及维护情况-->
                <div class="perfect-logo  perfect-logo2 perfect-information-logo mt40 mb22 clearfix">
                    <span class="pull-left">2.流转、前期处置及维护情况</span>
                    <?php
                    if (DtActionFilter::checkPackage('package_edit', $data['id']))
                        echo '<img src="/image/assetPackage/edit.png" class="edit-img base_transfer_history_edit" >';
                    ?>
                </div>

                <div class="information-maintenance base_transfer_history information-maintenance-disabled">
                    <?php echo \Yii::$app->view->renderFile('@app/views/package/investigation/transfer-history.php',
                        ['list' => $data['history'], 'editFlag' => $editFlag]); ?>
                </div>


                <!-- 资产包立项信息 3-7-->
                <div class="perfect-logo col-md-12 perfect-logo2 perfect-information-logo mt60 mb5">
                    <?php
                    if (DtActionFilter::checkPackage('package_edit', $data['id']))
                        echo '<img src="/image/assetPackage/edit.png" class="edit-img edit-img3-7" >';
                    ?>
                    <span class="pull-left">3.卖家提供的信息资料</span>
                </div>
                <div class="package_initation3_7">
                    <?php echo \Yii::$app->view->renderFile('@app/views/package/investigation/initation.php',
                        ['data' => $data['initation'], 'editFlag' => $editFlag]); ?>
                </div>
            </div>
            <!-- 1.立项信息 结束 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->

            <!-- 2. 报价信息-->
            <div class="perfect-information row container-fluid mb10" id="jdpg6" style="display: block;">
                <?php
                if (DtActionFilter::checkPackage('package_edit', $data['id']))
                    echo '<img src="/image/assetPackage/edit.png" class="edit-img initiation_price_detail_edit" >';
                ?>

                <div class="perfect-logo ">
                    <img src="/image/officeHall/uploadAssetPackage/wsxx.png" class="pull-left">
                    <span class="pull-left">报价信息</span>
                </div>

                <div class="initiation_price_detail">
                    <?php echo \Yii::$app->view->renderFile('@app/views/package/investigation/price-detail.php', ['data' => $data['initation']]) ?>
                </div>
            </div>


            <!-- 2.团队组成 开始 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->
            <div class="Transfer-information container-fluid row mb10 AssetPackageInformationEditing-team" id="jdpg2">
                <div class="perfect-logo ">
                    <img src="/image/officeHall/uploadAssetPackage/wsxx.png" class="pull-left">
                    <span class="pull-left">团队组成</span>
                </div>
                <?php echo \Yii::$app->view->renderFile('@app/views/package/investigation/group-users.php', ['data' => $data['group_users']]); ?>
            </div>
            <!-- 2.团队组成 结束 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->


            <!-- 3.工作计划    开始  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->
            <div class="maintenance row mb10 workPlan" id="jdpg3">
                <div class="perfect-logo ">
                    <img src="/image/officeHall/uploadAssetPackage/wsxx.png" class="pull-left">
                    <span class="pull-left">工作计划</span>
                </div>
                <div class="table-responsive pull-left table-responsive2">
                    <table class="table donot-edit">
                        <thead>
                        <tr>
                            <th class="text-left" style="width: 40%;">时间</th>
                            <th class="text-left">工作节点</th>
                        </tr>
                        </thead>
                        <tbody class="maintenance-tbody">
                        <?php
                        if (!empty($data['initation_plan']) && is_array($data['initation_plan'])) {
                            foreach ($data['initation_plan'] as $k => $v) {
                                $stage = explode('/', $v['stage']);
                                echo '<tr>
                                        <td><input type="text" value="' . date('Y/m/d', strtotime($stage[0])) . '-' . date('Y/m/d', strtotime($stage[1])) . '" disabled></td>
                                        <td><input type="text" value="' . $v['job'] . '" disabled></td>
                                    </tr>';
                            }
                        }
                        ?>
                        </tbody>
                    </table>
                </div>
            </div>
            <!-- 3.工作计划    结束  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->

            <!-- 4.团队收益分配 -->
            <div class="maintenance row mb10 workPlan pb40" id="jdpg4">
                <?php
                if (DtActionFilter::checkPackage('package_edit', $data['id']))
                    echo '<img src="/image/assetPackage/edit.png" class="edit-img initation_income_edit" >';
                ?>
                <div class="perfect-logo ">
                    <img src="/image/officeHall/uploadAssetPackage/wsxx.png" class="pull-left ">
                    <span class="pull-left">团队收益分配</span>
                </div>
                <div class="table-responsive pull-left table-responsive2 initation_income_tab">
                    <?php echo \Yii::$app->view->renderFile('@app/views/package/investigation/group-income.php', ['list' => $data['group_income']]); ?>
                </div>
            </div>
            <!-- 4. 团队收益分配结束!!!!!!!!!!!!!!! -->

            <!-- 5. 其他说明事项-->
            <div class="perfect-information row container-fluid pb10" id="jdpg5">
                <?php
                if (DtActionFilter::checkPackage('package_edit', $data['id']))
                    echo '<img src="/image/assetPackage/edit.png" class="edit-img" >';
                ?>
                <div class="perfect-logo mb5">
                    <img src="/image/officeHall/uploadAssetPackage/wsxx.png" class="pull-left">
                    <span class="pull-left">其他需要说明的事项</span>
                </div>
                <form class="form-horizontal" name="packageInitiationOther">
                    <div class="form-group" style="margin-bottom: 0;margin-top: 20px;">
                        <div class="pull-left label-div label-div4" style="width: 100%;">
                            <input type="hidden" name="PackageInitiation[id]" id="other_initiation_id"
                                   value="<?php echo $data['initation']['id']; ?>">
                            <textarea class="form-control textarea-edit" style="padding-bottom: 0;padding-left: 14px;" name="PackageInitiation[other_notes]" placeholder=""disabled><?php echo Html::encode($data['initation']['other_notes']); ?></textarea> 
                            <!-- <pre name="PackageInitiation[other_notes]"><?php echo Html::encode($data['initation']['other_notes']); ?></pre> -->
                        </div>
                    </div>
                </form>
                <div class="btns" style="margin-top: 20px; display: none;">
                    <button type="button"
                            class="btn btn-primary perfect-information-btn btns-primary btns-primary-save pull-right save_initation_other">
                        保存
                    </button>
                    <button type="reset"
                            class="btn btn-default perfect-information-btn btns-primary btns-primary-del pull-right cancel_initation_other">
                        取消
                    </button>
                </div>
            </div>

            <input type="hidden" id="edit_state" value="1">

            <input type="hidden" id="initation_package_id" value="<?php echo $data['id'] ?>">

            <input type="hidden" id="initation_base_url"
                   value="<?php echo Url::toRoute('package/initation-base-info', true); ?>">

            <input type="hidden" id="initation_base3_7_url"
                   value="<?php echo Url::toRoute('package-initation/base', true); ?>">

            <input type="hidden" id="initation_base_other_url"
                   value="<?php echo Url::toRoute('package-initation/base-other', true); ?>">

            <input type="hidden" id="initation_transfer_history_url"
                   value="<?php echo Url::toRoute('package-initation/transfer-history', true); ?>">

            <input type="hidden" id="initation_transfer_history_add_url"
                   value="<?php echo Url::toRoute('package-initation/add-transfer-history', true); ?>">

            <input type="hidden" id="initation_transfer_history_delete_url"
                   value="<?php echo Url::toRoute('package-initation/delete-transfer-history', true); ?>">

            <input type="hidden" id="initation_transfer_history_delete_url2"
                   value="<?php echo Url::toRoute('package-initation/delete-transfer-history2', true); ?>">

            <input type="hidden" id="initation_transfer_history_saves_url"
                   value="<?php echo Url::toRoute('package-initation/saves-transfer-history', true); ?>">

            <input type="hidden" id="initiation_price_detail"
                   value="<?php echo Url::toRoute('package-initation/price-detail', true); ?>">

            <input type="hidden" id="initation_income_base_url"
                   value="<?php echo Url::toRoute('package-initation-income/base-tab', true); ?>">

            <input type="hidden" id="initation_income_delete_url"
                   value="<?php echo Url::toRoute('package-initation-income/delete', true); ?>">

            <input type="hidden" id="initation_income_saves_url"
                   value="<?php echo Url::toRoute('package-initation-income/saves', true); ?>">
        </div>
    </div>
</div>

 <!-- textarea 高度设置对比div -->
	
<div style="max-height: 1px; overflow: hidden;">
	
	<div id="d5" style="visibility:hidden;min-height: 80px!important;"></div>

</div>

<script type="text/javascript">
	//页面加载时设置其他说明中 textarea的高度
	var val = $('.textarea-edit').val();
	  $("#d5").width($('.textarea-edit').width())
	  $("#d5").html("<pre>" +val+" "+"</pre>");
	  var h = $("#d5").height() ;
	  $('.textarea-edit').height(h);
</script>
